import asyncio
from frame.library.crawl4ai import *


class crawl4ai:
    @staticmethod
    async def get_markdown_content(url):
        async with AsyncWebCrawler() as crawler:
            result = await crawler.arun(
                url=url,
            )
            # print(result.markdown)
            return result.markdown


if __name__ == "__main__":
    crawl4ai = crawl4ai()
    # url = "https://www.zhihu.com/question/655790793/answer/3498123527"
    # url = "https://www.xsyq.cn"
    url = "https://www.zishuju.cn"
    html = asyncio.run(crawl4ai.get_markdown_content(url))
    print(html)
